package net.jjjshop.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 订单支付类型枚举
 */
@Getter
@AllArgsConstructor
public enum OrderAuthStatusEnum {
    //订单芝麻先享状态
    NORMAL("未授权", 10),
    PASS_THE_AUDIT("已授权", 20),
    FAIL_THE_AUDIT("授权失败", 30);
    private String name;
    private Integer value;

    //查找name
    public static String getName(Integer value) {
        String name = null;
        OrderAuthStatusEnum[] enums = values();    //获取所有枚举集合
        for (OrderAuthStatusEnum item : enums) {
            if (item.getValue().intValue() == value.intValue()) {
                name = item.getName();
                break;
            }
        }
        return name;
    }

}
